package cn.com.ustudy.course.core.model.entity;

import cn.com.ustudy.course.core.model.enums.UserType;
import cn.melonlib.cores.commons.model.entity.StringIdEntity;
import cn.melonlib.graphql.annos.GraphqlField;
import cn.melonlib.graphql.annos.GraphqlType;
import cn.melonlib.graphql.annos.GraphqlTypeDeclare;
import cn.melonlib.graphql.model.enums.GraphqlTypeMode;
import lombok.Data;

import java.util.List;

@Data
@GraphqlType(comment = "用户信息",declares = {@GraphqlTypeDeclare(name = "User",mode = GraphqlTypeMode.VIEW),@GraphqlTypeDeclare(name = "UserInput",mode = GraphqlTypeMode.INPUT)})
public class User extends StringIdEntity {


    public User(){}

    public User(String code, String name, Department department, Post post, UserType userType, List<String> tags, List<Permission> permissions, Boolean activated, Integer status) {
        this.code = code;
        this.name = name;
        this.department = department;
        this.post = post;
        this.userType = userType;
        this.tags = tags;
        this.permissions = permissions;
        this.activated = activated;
        this.status = status;
    }

    @GraphqlField(comment = "用户名称",required = true)
    private String code;

    private String name;

    private Department department;

    private Post post;

    private UserType userType=UserType.GUEST;

    private List<String> tags;

    private List<Permission> permissions;

    private Boolean activated=true;

    private Integer status=1;
}
